package com.cci.kangdao.utilTool;

import com.fasterxml.jackson.databind.ObjectMapper;


import java.util.HashMap;
import java.util.Map;

/**
 * @author linjiankun
 * @date 2023/11/2 14:29
 */
public class MapStringConvert {

    public static String mapToString(Map<String, Object> map) throws Exception {
        ObjectMapper objectMapper = new ObjectMapper();
        return objectMapper.writeValueAsString(map);
    }

    public static Map<String, Object> stringToMap(String mapString) throws Exception {
        ObjectMapper objectMapper = new ObjectMapper();
        return objectMapper.readValue(mapString, HashMap.class);
    }
}
